package com.aichongbang.acb.service.impl;

import com.aichongbang.acb.po.Pet;
import com.aichongbang.acb.mapper.PetMapper;
import com.aichongbang.acb.service.IPetService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author acb
 * @since 2021-05-27
 */
@Service("petService")
public class PetServiceImpl extends ServiceImpl<PetMapper, Pet> implements IPetService {

    @Resource
    private PetMapper petMapper;

    @Override
    public List<Pet> getAll() {
        return petMapper.getAll();
    }

    @Override
    public int add(Pet pet) {
        return petMapper.add(pet);
    }

    @Override
    public boolean update(Pet pet) {
        int n= petMapper.update(pet);
        return n > 0 ? true : false;
    }

    @Override
    public boolean delete(Integer id) {
        int n = petMapper.delete(id);
        return n > 0 ? true : false;
    }

}
